LeetCode Reverse String Solution Explained - JavaScript